/* This .do file runs all the analysis files and generates the outputs for the paper:
Behavioral Biases among Producers: Experimental Evidence of Anchoring in Procurement Auctions

Author: Pallavi Shukla
Version: Sep 28, 2021
 */

clear all
set more off

version 14

/** The following datasets are used in the analysis:
1. SS1and2.dta - contains data for  StewardShares (SS) I and II 
2. SS3.dat - contains data for StewardShares III 
3. SSpooled.dta - pooled dataset combining observations from SS I, II and III - this is created in .do file 01_appendSS1and2with3.do

*/

/*external stata programs used in analysis*/
* comment out if already installed 


ssc install estout                // for storing, exporting regression results
ssc install coefplot              // for plotting regression coefficients
ssc install blindschemes          // used for graph formatting
ssc install grc1leg2 			  // used for combining plots
ssc install iebaltab              // used for descriptive tables creation

//set directory
//cd "F:/Dropbox/Ferraro Shukla/data_code_PS"
cd "... "   //Set directory path to project folder


gl outputs "outputs"
capture mkdir "$outputs"              //create folder for storing results 

gl code "code"

global dta "data"              //folder with datasets used in analysis

// Append data from SS 1 & 2 with SS 3  -- keeping covariates that are common across both datasets
 
do "${code}/01_appendSS1and2with3.do"


// Fig 1. Descriptive plots 

do "${code}/02_Fig1_descriptiveplots.do"

// Fig 2. Treatment effect coefficient plots (from GLM logit models)

do "${code}/03_Fig2_coefplots_glm.do"

// Fig 3. Moderating effect of experience

do "${code}/04_Fig3_experience_effect.do"


// Appendix Tables A1 & A2: Descriptive statistics

do "${code}/05_TableA1A2_desctables.do"

// Appendix Table A4: No selection in bidding participation

do "${code}/06_TableA4_participation.do"


// Appendix Table A5: Robustness across specifications

do "${code}/07_TableA5_varyingspecs.do"


// Appendix Table A6: Robustness across varying definitions of experience

do "${code}/08_TableA6_varying_exp.do"



